home *** CD-ROM | disk | FTP | other *** search
- // CrackMe3Dlg.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "CrackMe3.h"
- #include "CrackMe3Dlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CCrackMe3Dlg dialog
-
- CCrackMe3Dlg::CCrackMe3Dlg(CWnd* pParent /*=NULL*/)
- : CDialog(CCrackMe3Dlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CCrackMe3Dlg)
- m_reg = _T("Not registered!");
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
-
- void CCrackMe3Dlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCrackMe3Dlg)
- DDX_Text(pDX, IDC_REG, m_reg);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CCrackMe3Dlg, CDialog)
- //{{AFX_MSG_MAP(CCrackMe3Dlg)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CCrackMe3Dlg message handlers
-
- BOOL CCrackMe3Dlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- // TODO: Add extra initialization here
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-
- // If you add a minimize button to your dialog, you will need the code below
- // to draw the icon. For MFC applications using the document/view model,
- // this is automatically done for you by the framework.
-
- void CCrackMe3Dlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
-
- // The system calls this to obtain the cursor to display while the user drags
- // the minimized window.
- HCURSOR CCrackMe3Dlg::OnQueryDragIcon()
- {
- return (HCURSOR) m_hIcon;
- }
-
- /*******Pole urΦujφcφ sprßvnΘ vypln∞nφ zaÜkrtßvacφch polφΦek-tohle si m∙₧ete dovolit opravdu
- jen ve cviΦnΘm p°φkladu urΦenΘm k nßcviku crackingu*******/
- int registration[3][7] =
- {
- {1,0,1,1,1,0,1},
- {1,1,0,1,0,1,1},
- {1,0,1,1,1,0,1},
- };
-
- /*******Pole s identifikßtory zaÜkrtßvacφch polφΦek*******/
- int items[3][7] =
- {
- {IDC_R0C0,IDC_R0C1,IDC_R0C2,IDC_R0C3,IDC_R0C4,IDC_R0C5,IDC_R0C6},
- {IDC_R1C0,IDC_R1C1,IDC_R1C2,IDC_R1C3,IDC_R1C4,IDC_R1C5,IDC_R1C6},
- {IDC_R2C0,IDC_R2C1,IDC_R2C2,IDC_R2C3,IDC_R2C4,IDC_R2C5,IDC_R2C6},
- };
-
- void CCrackMe3Dlg::OnOK()
- {
- int i,j;
- BOOL Flag = FALSE;
-
- for (i = 0; i < 3; i++) // zpracovßnφ °ßdk∙
- {
- for (j = 0; j < 7; j++) // zpracovßnφ sloupc∙
- {
- if (((CButton*)GetDlgItem(items[i][j]))->GetCheck() == registration[i][j]) // porovnßnφ aktußlnφho stavu zaÜkrtßvacφch
- { // polφΦek s tφm sprßvn²m
- Flag = TRUE;
- continue;
- }
- else
- {
- Flag = FALSE;
- break;
- }
- }
- if (!Flag)
- break;
- }
- if (Flag)
- m_reg = "Registration successful!";
- else
- m_reg = "Not registered!";
-
- UpdateData(FALSE);
- }
-
-